package com.ym521.ymrouter.facade.model;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

/**
 * @author Ym
 * E-mail: 2435970206@qq.com
 * createTime:2023/12/23
 * explain: 用于获取目标对象的类型。
 */
public class TypeWrapper<T> {
    protected final Type type;
    protected TypeWrapper() {
        Type superClass = getClass().getGenericSuperclass();

        type = ((ParameterizedType) superClass).getActualTypeArguments()[0];
    }

    public Type getType() {
        return type;
    }
}
